<?php

/*

  Action – Victory	$4

  Set aside this and another card from your hand. Return them to your deck at the end of the game.
  Worth 2 Victory Points

 */

class Island extends Card implements iAction, iKingdom, iVictory, iSeaside {

    public function __construct() {
        parent::__construct("Island", 4);
        $this->victoryPoints = 2;
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "Worth 2 Victory Points",
            "Set aside this and another card from your hand. Return them to your deck at the end of the game.");
    }

    public function play(Game $game, $isRealCard) {
        $playHand = $game->getPlayHand();
        if (sizeof($playHand) > 0) {

            $playHand = getUniqueCards($playHand);
            if (sizeof($playHand) > 1) {
                $output = MySocket::GetUserReply($game, Input_ChooseOne, $playHand, 1, 1, null, "What card set aside with island");
                $card_name = $output[0];
            } else {
                $card_name = $playHand[0];
            }

            $game->moveCardFromPileToPile($this, PlayArea, IslandPile);
            $card = $game->moveCardFromPileToPile($card_name, PlayHand, IslandPile);
            ScreenDisplay::addScreenMessage($game, true, "put " . nicePrint($this) . " with " . nicePrint($card) . " aside", "puts " . nicePrint($this) . " with " . nicePrint($card) . " aside");
        } else {
            $game->moveCardFromPileToPile($this, PlayArea, IslandPile);
            ScreenDisplay::addScreenMessage($game, true, "put " . nicePrint($this) . " with nothing aside", "puts " . nicePrint($this) . " with nothing aside");
        }
        $game->cardActionFinished();
        return true;
    }

}

?>